<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>发布文章</title>
    <!-- 导入layui的样式文件 -->
    <link rel="stylesheet" href="/assets/lib/layui/css/layui.css">
    <!-- 导入cropper裁剪区域的样式文件 -->
    <link rel="stylesheet" href="/assets/lib/cropper/cropper.css">
    <!-- 导入发布文章的css样式文件 -->
    <link rel="stylesheet" href="/assets/css/atricle/art_pub.css">
</head>

<body>
    <div class="layui-card">
        <div class="layui-card-header">写文章</div>
        <div class="layui-card-body">
            <!-- 发布文章的表单 -->
            <form class="layui-form" id="form_pub">
                <!-- 文章标题区域 -->
                <div class="layui-form-item">
                    <label class="layui-form-label">文章标题</label>
                    <div class="layui-input-block">
                        <input type="text" name="title" lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <!-- 文章类别区域 -->
                <div class="layui-form-item">
                    <label class="layui-form-label">文章类别</label>
                    <div class="layui-input-block">
                        <select name="cate_id" lay-verify="required">
                           
                          </select>
                    </div>
                </div>
                <!-- 文章内容区域 -->
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">文章内容</label>
                    <div class="layui-input-block" style="height: 400px;">
                        <textarea name="content" placeholder="请输入内容"></textarea>
                    </div>
                </div>
                <!-- 文章封面区域 -->
                <div class="layui-form-item ">
                    <label class="layui-form-label">文章封面</label>
                    <div class="layui-input-block">
                        <div class="cropper-container">
                            <!-- 裁剪区域内显示的图片 -->
                            <div class="cropperBox">
                                <img src="/assets/images/sample2.jpg" id="cropper-img">
                            </div>
                            <!-- 预览裁剪区域 -->
                            <div class="right-box">
                                <!-- 预览区域 -->
                                <div class="imag-preview"></div>
                                <!-- 文件域 -->
                                <input type="file" id="fileCover" accept="image.jpeg,image/png,image/gif">
                                <!-- 选择封面按钮 -->
                                <button class="layui-btn  layui-btn-danger " id="btnChooseCoverImage">选择封面</button>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- 发布按钮区域 -->
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <!-- 因为这两个按钮只是觉得发布的文章是何种状态，实质是都要进行数据的提交的，所以两个按钮都要加 lay-submit  -->
                        <button class="layui-btn" lay-submit id="btnPublish">发布</button>
                        <button lay-submit class="layui-btn layui-btn-primary" id="saveText">存为草稿</button>
                    </div>
                </div>
            </form>


        </div>
    </div>
    <!-- 定义文章类别下拉菜单的模版框架-->
    <script type="text/html" id="cate-select">
        <option value="">请选择文章类别</option>
        {{each data}}
        <option value="{{$value.Id}}">{{$value.name}}</option>
        {{/each}}
    </script>
    <!-- 导入jQuery文件 -->
    <script src="/assets/lib/jquery.js"></script>
    <!-- 导入layui的js文件 -->
    <script src="/assets/lib/layui/layui.all.js"></script>
    <!-- 导入模版引擎的js文件 -->
    <script src="/assets/lib/template-web.js"></script>
    <!-- 导入富文本需要使用的js -->
    <script src="/assets/lib/tinymce/tinymce.min.js"></script>
    <script src="/assets/lib/tinymce/tinymce_setup.js"></script>
    <!-- 按照如下顺序依次导入cropper裁剪区域的js文件 -->
    <script src="/assets/lib/cropper/Cropper.js"></script>
    <script src="/assets/lib/cropper/jquery-cropper.js"></script>
    <!-- 导入统一挂载请求配置对象的js文件 -->
    <script src="/assets/js/baseAPI.js"></script>
    <!-- 导入发布文章的js文件 -->
    <script src="/assets/js/article/art_pub.js"></script>
</body>

</html>